package controllers

import (
	"github.com/astaxie/beego"
	"math/rand"
	"strconv"
)
//继承主要的controller
type HelloController struct {
	beego.Controller
}
//定义类接口，定义数据和模板,类函数重写
//此处的this是一个变量
//修改文件后bee会自动重新加载和编译
func (this *HelloController) Get() {
	intRand :=rand.Intn(10000);
	strRand:=strconv.Itoa(intRand)
	this.Ctx.WriteString("<h1>Hello World. #"+strRand+"</h1>")
}

func (this *IndexController) Post() {
	this.Ctx.WriteString("post request")

}

